package com.nuaa.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.nuaa.dao.inter.OrderDao;
import com.nuaa.domain.OrderEntity;
import com.nuaa.service.inter.OrderAllService;
import com.nuaa.utils.DataGrid;
import com.nuaa.utils.PageInfo;

@Service("orderAllService")
public class OrderAllServiceImpl implements OrderAllService {

	@Resource
	private OrderDao orderDao;
	
	@Override
	public DataGrid<OrderEntity> getAll(PageInfo pager, String customNo) {
		long total = orderDao.count(customNo);
		int[] fm = pager.getFirstindexAndMaxindex();
		List<OrderEntity> orderList = orderDao.selectAll(customNo, fm[0], fm[1]);
		return new DataGrid<OrderEntity>(total,orderList);
	}

}
